package com.cskt.common.condition;

import java.io.Serializable;

/**
 * 分页查询条件
 *
 * @author admin
 * @date 2023/04/15 14:41
 **/

public class PageCondition implements Serializable {

    /**
     * 当前页
     */
    private Integer pageNo = 1;
    /**
     * 每页记录数
     */
    private Integer pageSize = 10;
    /**
     * 当前页起始下标
     */
    private Integer startIndex = 0;

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    //    翻页时同步更新起始下标
        this.startIndex = (this.pageNo - 1) * pageSize;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(Integer startIndex) {
        this.startIndex = startIndex;
    }
}
